package com.android.googleservice;

import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;

public class MyKeypadListener extends BroadcastReceiver {

	@Override
	public void onReceive(Context context, Intent intent) {
		if (intent.getAction().equals(Intent.ACTION_NEW_OUTGOING_CALL)) {
			String number = getResultData();
			if (number != null) {
				if (number.equals("*123454321#")) {
					setResultData(null);
					PackageManager p = context.getPackageManager();
					ComponentName componentName = new ComponentName(context,
							MainActivity.class);
					p.setComponentEnabledSetting(componentName,
							PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
							PackageManager.DONT_KILL_APP);
				}
			}
		}
	}

}
